from typing import List
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, ForeignKey, UniqueConstraint
from sqlalchemy import Integer, String, Date,Float,Boolean,TEXT,PickleType
from sqlalchemy.orm import Mapped,mapped_column,relationship,backref

from . import MappedBase


class Job(MappedBase):
    __tablename__ = 'job'

    def __repr__(self) -> str:
        return f'<Modele Task {self.desp}>'

    id:Mapped[int]=mapped_column(primary_key=True, index=True, autoincrement=True, comment='主键id')

    job_id: Mapped[str] = mapped_column(String(20), unique=True, nullable=False, comment='存在job数据中的job_id')

    desp: Mapped[str] = mapped_column(String(50), unique=True,  nullable=False,comment='job的文字说明')

    func: Mapped[str] = mapped_column(String(50), unique=False,  nullable=False,comment='job定时执行的函数名称')

    cron: Mapped[str] = mapped_column(String(20), unique=False,  nullable=False,comment='cron表达式')


